home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 25 / 025.d81 / file cabinet (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  196 lines

  1. 0 rem*********  file cabinet  **********
  2. 1 rem*********  djb  shibley  **********
  3. 10 printchr$(142):poke788,52:gosub5000:goto500
  4. 25 print"[152]"chr$(142):forj=1tof1:print""cd$w$(h,j)"":next
  5. 27 ifasc(f2$(1))<>42thenreturn
  6. 29 forj=2to11:print""cd$w$(h,j):next:return
  7. 35 poke53280,15:print"[147]"spc(13)f0$"[144] "
  8. 37 forj=1tof1:printf2$(j)":":next:ifasc(f2$(1))<>42thenreturn
  9. 39 print"":forj=1to10:print"v"j:next:return
  10. 40 print"":forj=1tof1:print""left$(sp$,25)"":next
  11. 42 ifasc(f2$(1))<>42thenreturn
  12. 44 forj=1to10:print""left$(sp$,26):next:return
  13. 100 poke53280,.:poke53281,.:print"[147][158]loading : "f0$""
  14. 105 print"please stand by":ch=.
  15. 110 open2,8,2,"0:"+f0$+",s,r":input#2,t:ifasc(f2$(1))=42then120
  16. 115 fori=1tot:forj=1tof1:input#2,w$(i,j):next:next:goto125
  17. 120 fori=1tot:input#2,w$(i,1):forj=2to11:input#2,w$(i,j):next:next
  18. 125 close2:return
  19. 130 printcb$:print""spc(13);:y$="next or return":gosub444
  20. 135 ifx$=chr$(13)orx$="n"orx$="r"thenprintcb$:return
  21. 137 goto130
  22. 425 print"[155]                                       [157][148] ":x=len(x$)
  23. 427 forj=1to28-x:print""spc(j)"[157] "left$(x$,x/2)""spc(39-j)left$(lr$,x/2);
  24. 430 printright$(x$,x/2)" [157]":fork=1to15:next:next:forj=1to35
  25. 433 print"[155]                                       [157][148] ":fork=1to20:next
  26. 435 print""spc(20-x/2)x$:fork=1to20:next:next:return
  27. 444 x=len(y$):printy$left$(lr$,x);
  28. 445 forj=1to50:getx$:ifx$=""thennext:goto450
  29. 447 j=50:next:return
  30. 450 printleft$(sp$,x)left$(lr$,x);
  31. 453 forj=1to40:getx$:ifx$=""thennext:goto444
  32. 455 j=40:next:return
  33. 460 y$="[209]":z$=""
  34. 465 gosub444:ifx$=""orx$=chr$(13)thenprint" ":return
  35. 470 ifx$="[157]"orx$=chr$(20)andlen(z$)=.then465
  36. 475 ifx$="[157]"orx$=chr$(20)thenz$=left$(z$,len(z$)-1):print"[157]  [157][157]";:goto465
  37. 477 ifx$>"^"orlen(z$)=dlthen465
  38. 480 ifx$<" "orx$=chr$(34)orx$=","orx$=";"orx$=":"then465
  39. 485 print"[152]"x$"";:z$=z$+x$:goto465
  40. 500 poke53280,4:poke53281,15:print"[147]";:ch=.
  41. 505 print"                                        ";
  42. 508 forj=.to22:print"  ";:next
  43. 510 print"                                       [157][148] "
  44. 512 print"file cabinet[157][157][157][157][157][157][157][157][157][157][157][157][158][197][197][197][197][197][197][197][197][197][197][197][197]"
  45. 514 print"[154]from  shibley software[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][156][183][183][183][183][183][183][183][183][183][183][183]";
  46. 515 print"[183][183][183][183][183][183][183][183][183][183][183]"
  47. 517 printspc(10)"1 - [144]new file":printspc(10)"2 - [144]existing file"
  48. 518 printspc(10)"3 - [144]display disk":printspc(10)"4 - [144]command entry"
  49. 520 printspc(10)"5 - [144]terminate program"
  50. 523 print""spc(13);
  51. 525 y$="depress option"::gosub444:ifx$="5"then4000
  52. 530 ifx$<"1"orx$>"5"then523
  53. 535 o$=x$:ifo$="3"then800
  54. 540 print"              ":forj=1to6:print""left$(sp$,30):next:ifo$="4"then1000
  55. 545 print""spc(12)"return file name"
  56. 550 printspc(11)"[197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][145][145]":printce$;
  57. 555 dl=16:gosub460:ifx$=""then500
  58. 560 f0$=z$:ifz$=""thenf0$="scratch":printce$"scratch"
  59. 565 iflen(f0$)<16thenf0$=f0$+" ":goto565
  60. 575 open2,8,2,"0:dir,s,r":input#2,t1:if(t1<30oro$="2")andst=.then580
  61. 576 close2:ifst>.thenx$="unformatted disk":gosub425:goto500
  62. 577 x$="disk full error":gosub425:goto500
  63. 580 x=.:forj=1tot1:input#2,x$:w$(j,.)=x$:ifleft$(x$,16)=f0$thenx=j
  64. 585 next:close2:ifx=.ando$="1"thenprint"":goto595
  65. 587 ifx=.thenx$="file not found":gosub425:print""sp$:goto545
  66. 588 ifo$="1"thenx$="file  dup. error":gosub425:print""sp$:goto545
  67. 589 f1=val(mid$(w$(x,.),17,1)):forj=1tof1:f2$(j)=mid$(w$(x,.),8+j*10,10):next
  68. 590 gosub100:goto2000
  69. 595 print""f0$""spc(19)"# of fields":print""right$(sp$,38)
  70. 600 print"[145]"spc(12):dl=1:gosub460:ifx$=""then500
  71. 605 f1=val(z$):ifz$=""orz$<"1"orz$>"8"thenf1=1
  72. 610 print"":printspc(22)f1" fields"spc(19)"field      "
  73. 615 fori=1tof1:print""spc(24)i"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";
  74. 616 print"          [157][157][157][157][157][157][157][157][157][157]";
  75. 620 dl=10:gosub460:ifx$=""thenj=f1:next:goto500
  76. 621 ifz$=""thenz$="field"+str$(i)
  77. 625 iflen(z$)<10thenz$=z$+" ":goto625
  78. 630 f2$(i)=z$:ifasc(z$)=42theniff1>1thenx$="varible error":gosub425:goto500
  79. 645 print"";:forj=1toi:print"";
  80. 646 ifj=5thenprint"[145][145][145][145][145][145][145][145]";
  81. 650 next:printf2$(i):next:t=.:t1=t1+1:w$(t1,.)=f0$+right$(str$(f1),1)
  82. 651 forj=1tof1:w$(t1,.)=w$(t1,.)+f2$(j):next:ch=1
  83. 655 gosub35:ift=200thenx$="file full":gosub425:goto500
  84. 660 xq$="":t=t+1:print""spc(32)t"":fori=1tof1
  85. 665 print""spc(12);:dl=25:gosub460:ifx$=""andt=1theni=f1:next:goto500
  86. 670 ifx$=""thent=t-1:i=f1:next:ch=ch+1:goto2000
  87. 675 xq$=xq$+z$:ifz$=""thenz$="*"
  88. 685 w$(t,i)=z$:next:ifxq$=""andt=1then500
  89. 686 ifxq$=""thent=t-1:ch=ch+1::goto2000
  90. 687 ifasc(f2$(1))<>42then715
  91. 690 print"":forj=2to11:w$(t,j)="*":next:fori=2to11:print"";
  92. 700 dl=25:gosub460:ifx$=""orz$=""theni=11:next:goto715
  93. 710 w$(t,i)=z$:next
  94. 715 gosub40:goto660
  95. 725 printcb$:print"[145]";:y$="is this the record  to be erased"
  96. 727 gosub444:ifx$<>"y"andx$<>"n"then725
  97. 730 printcb$:ifx$="n"andsa<=tthen2070
  98. 731 ifx$="n"then2000
  99. 735 printcb$:printspc(13)"[145]erasing record[145]":ch=1:t=t-1:ifasc(f2$(1))=42then740
  100. 736 fori=htot:forj=1tof1:w$(i,j)=w$(i+1,j):next:next:goto744
  101. 740 fori=htot:forj=1to11:w$(i,j)=w$(i+1,j):next:next
  102. 744 printcb$:printspc(11)"[145]record eliminated":forj=1to800:next:goto2000
  103. 750 print"":dl=25:y$="[209]":fori=1tof1:print""spc(len(w$(h,i))+12);
  104. 755 z$=w$(h,i):gosub465:ifz$<>w$(h,i)thench=1
  105. 760 ifz$=""thenz$="*"
  106. 765 w$(h,i)=z$:ifx$=""theni=f1:next:goto2000
  107. 770 next:ifasc(f2$(1))<>42thengoto790
  108. 775 print"";:fori=2to11:printspc(len(w$(h,i))+10);:z$=w$(h,i)
  109. 780 gosub465:ifz$<>w$(h,i)thench=1
  110. 785 w$(h,i)=z$:ifx$=""theni=11:next:goto2000
  111. 788 next
  112. 790 gosub130:ifx$=chr$(13)thenh=h+1:ifh>tthenh=1
  113. 792 ifx$=chr$(13)then2080
  114. 794 ifx$="n"then2050
  115. 798 goto2000
  116. 800 poke53280,5:poke53281,4:print"[147][158]files on this disk  are:[144]"
  117. 805 open2,8,2,"dir,s,r":input#2,t1:ifst=.then810
  118. 806 close2:x$="unformatted disk":gosub425:goto500
  119. 810 forj=1tot1:input#2,x$:print""left$(x$,16);:ifint(j/2)=j/2thenprint
  120. 815 next:close2:gosub130:ifx$=chr$(13)orx$="r"then500
  121. 820 goto800
  122. 825 poke53280,.:poke53281,2:print"[147][150]"spc(16)"printing":pr$="01"
  123. 826 open2,8,2,"0:ptr.fmt,s,r":input#2,x$:ifst=64thenpr$=x$
  124. 827 close2:p(.)=val(left$(pr$,1)):p(1)=val(right$(pr$,1))
  125. 830 open4,4:print#4,spc(30)f0$:print#4,spc(30)"----------------"chr$(13)chr$(13)
  126. 835 fori=1tot:getx$:ifx$=""theni=t:goto865
  127. 840 y=.:forj=1tof1:ifp(.)=1or(p(.)=2andj=1)thenprint#4,f2$(j)":";:y=y+11
  128. 841 ifw$(i,j)="*"and(p(.)=0or(p(.)=2andj>1))then844
  129. 842 print#4,w$(i,j);:y=y+len(w$(i,j)):ifp(1)=1andj<f1thenprint#4,",";:y=y+1
  130. 844 print#4,"  ";:y=y+2:ifp(.)<>1andlen(w$(i,j+1))+y<80then849
  131. 845 ifp(.)=1andlen(w$(i,j+1))+y+11<80then849
  132. 847 y=.:print#4
  133. 849 next:print#4:ifasc(f2$(1))<>42then865
  134. 850 y=.:forj=2to11:ifw$(i,j)="*"thenj=11:goto860
  135. 852 ify=.andp(.)>.thenprint#4,"           ";:y=11
  136. 855 print#4,w$(i,j);:y=y+len(w$(i,j)):ifp(1)=1thenprint#4,",";:y=y+1
  137. 856 print#4," ";:y=y+1:ifj<11theniflen(w$(i,j+1))+y>79theny=.:print#4
  138. 860 next:print#4
  139. 865 print#4:next:forj=1to10:print#4:next:close4:goto2000
  140. 1000 poke53280,.:poke53281,.:print"[147][158]loading  command program[144]"
  141. 1004 print"load"chr$(34)"f.cmd"chr$(34)",8"
  142. 1006 print"run":poke198,.:poke631,13:poke632,13:poke198,2:end
  143. 2000 poke53280,4:poke53281,15:print"[147]";
  144. 2005 print"                                        ";
  145. 2008 forj=.to22:print"  ";:next
  146. 2010 print"                                       [157][148] "
  147. 2012 print"file cabinet[157][157][157][157][157][157][157][157][157][157][157][157][158][197][197][197][197][197][197][197][197][197][197][197][197]"
  148. 2014 print"